<div class="panel panel-default panel-intro">
    {:build_heading()}
    <div class="panel-body">
        <div id="myTabContent" class="tab-content">
            <div class="tab-pane fade active in" id="one">
                <div class="widget-body no-padding">
                    <div id="toolbar" class="toolbar">
                        <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
                        <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('visiting/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
                        {if $Think.session.rule_id  eq 5}
                            {else/}
                            {if $Think.session.rule_id  eq 3}
                                {else/}
                                 <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('visiting/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
                        {/if}
                            {/if}
                                   <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('visiting/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
                        {if $Think.session.rule_id  eq 1}   <a class="btn btn-info btn-disabled disabled btn-selected " href="javascript:;"><i class="fa fa-leaf"></i> 群发短信</a>{/if}
<!--                        {if $Think.session.rule_id  eq 1 or $Think.session.rule_id  eq 3}   <a class="btn btn-info btn-disabled disabled btn-selectedd" href="javascript:;"><i class="fa fa-leaf"></i> 讲解排班</a>{/if}-->
                        <!--                        <a href="javascript:;" class="btn btn-danger btn-send btn-disabled disabled {:$auth->check('visiting/send')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('短送发信')}</a>-->
<!--                        <a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('visiting/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>-->
<!--                        <div class="dropdown btn-group {:$auth->check('visiting/multi')?'':'hide'}   ">-->
<!--                       <a href="Visiting/export" class="btn btn-success {:$auth->check('visiting/multi')?'':'hide'}" title="{:__('Multi')}" >{:__('导出')}</a>-->
                            <ul class="dropdown-menu text-left" role="menu">
                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
                            </ul>
                           <a href="javascript:;" id="confirm" class="btn btn-success" title="{:__('预约码确认')}" id="" data-url=""  data-multiple="false">{:__('预约码确认')}</a>
                        </div>
                    </div>
<!--                {$Think.session.rule_id}-->
                <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
                           data-operate-edit="{:$auth->check('visiting/edit')}"
                           data-operate-del="{:$auth->check('visiting/del')}"
                           width="100%">
                    </table>

                </div>
            </div>

        </div>
    </div>
</div>
<script src="/lib/jquery/1.9.1/jquery.min.js"></script>
<script src="/lib/layer/2.4/layer.js"></script>
<script>

    // $(".fixed-table-container").find("table").find('thead:eq(1)').css("display","none");
    //标记为全部通过
    $("#confirm").on('click',function () {

        //prompt层
        layer.prompt({title: '输入预约码，并确认'}, function(code, index){
            layer.close(index);

            url = "Visiting/confirmFromCode?code="+code;


            $.ajax({
                type: "POST",
                dataType: "json",
                url: url,
                success: function (data) {
                    if(data.code == 1){
                        layer.msg(data.msg, {
                            time: 0 //不自动关闭
                            ,btn: ['允许', '不允许']
                            ,yes: function(index){
                                layer.open({
                                    type: 2,
                                    skin: 'layui-layer-rim', //加上边框
                                    area: ['840px', '480px'], //宽高
                                    content: 'Visiting/edit/id/'+data.data.id
                                });
                            }
                        });
                    }else{
                        layer.msg(data.msg);
                    }


                }
            })


        });
    });

</script>
